<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="description" content="personal blog login page" />
    <meta name="author" content="lihongpeng" />
    <title>简易BLOG</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/jianyi-style.css" />
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
    <script type="text/javascript" src="${basePath}/js/ourjs/webSocket_init.js"></script>
    <![endif]-->
</head>
<header class="jy-blue">
    <div class="container header clearfix" id="header2">
        <a href="/index"><img src="/img/jianyi-logo.png" class="jy-logo" /></a>
        <div class="user-header" id="header1" >
            <#if user??>
                <div id="div1" class="dropdown">
                    <a id="drop11" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                        <!--<img src="${(user.userInfoVO.avatarUrl)!'/img/college.png'}" />-->
                        <#if user.userInfoVO.avatarUrl??>
                            <img src="<#if user.userInfoVO.avatarUrl?contains('http:')>${(user.userInfoVO.avatarUrl)}<#elseif user.userInfoVO.avatarUrl?contains('files')>http://image.jianyiblog.com/${(user.userInfoVO.avatarUrl)}</#if>" />
                            <#else>
                                <img src="/img/college.png" />
                        </#if>
                        <span class="caret"></span>
                    </a>
                    <div class="dropdown-menu" aria-labelledby="drop1" id="close_div1">
                        <a href="/personal/center" class="list-group-item">我的主页</a>
                        <a href="#" class="list-group-item">收藏的文章</a>
                        <a href="#" class="list-group-item">喜欢的文章</a>
                        <a href="#" class="list-group-item">我的钱包</a>
                        <a href="#" class="list-group-item">关注</a>
                        <a href="/personal/settings" class="list-group-item">设置</a>
                        <a href="#" class="list-group-item">帮助与反馈</a>
                        <a href="/login/logout" class="list-group-item">退出</a>
                    </div>
                </div>
                <#else>
                    <a class="login-out" href="/register/toSignUp">注册</a>
                    <a class="login-out" href="/login">登录</a>
            </#if>
        </div>

        <div class="dropdown" id="div2">
            <a id="drop1" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                <span class="glyphicon glyphicon-bell lg-size"></span><span class="badge" id="messages">${Session.messages!""}</span>
            </a>
            <div class="dropdown-menu" aria-labelledby="drop1" id="close_div2">
                <a href="#" class="list-group-item">评论</a>
                <a href="${basePath}/message" onclick="toWebSocket()" id="webSW" class="list-group-item">私信<span class="badge">${Session.secret_msg!""}</span></a>
                <!--<a href="#" class="list-group-item">投稿请求</a>-->
                <a href="#" class="list-group-item">喜欢和赞</a>
                <a href="#" class="list-group-item">关注<span class="badge">${Session.attention_count!""}</span></a>
                <!--<a href="#" class="list-group-item">赞赏</a>-->
                <a href="#" class="list-group-item">其他消息<span class="badge">${Session.sys_msg!""}</span></a>
            </div>
        </div>
        <form action="" method="" class="form-search">
            <input type="text" name="" id="searchInput" value="" placeholder="搜索" x-webkit-speech="" x-webkit-grammar="builtin:search" lang="zh-CN">
            <a class="search-btn" href="javascript:;"><span class="glyphicon glyphicon-search"></span></a>
        </form>
        <!-- 校验用户是否登录 -->
        <#if user??>
            <button type="button" class="btn btn-info" id="write-article">写博客</button>
        </#if>
    </div>
    <script type="text/javascript">
        /*头部鼠标移动事件*/
        document.getElementById("drop11").onmousemove=function(){
            document.getElementById("div1").setAttribute("class","dropdown open");
        };
        document.getElementById("close_div1").onmouseleave=function(){
            document.getElementById("div1").setAttribute("class","dropdown");
        };
        document.getElementById("header1").onmouseleave=function(){
            document.getElementById("div1").setAttribute("class","dropdown");
        };
        document.getElementById("drop1").onmousemove=function(){
            document.getElementById("div2").setAttribute("class","dropdown open");
        };
        document.getElementById("close_div2").onmouseleave=function(){
            document.getElementById("div2").setAttribute("class","dropdown");
        };
        document.getElementById("header1").onmouseleave=function(){
            document.getElementById("div2").setAttribute("class","dropdown");
        };
    </script>
</header>